Blitz (38/640)

From:Oliver Marks
Date:12 Aug 99 at 18:10:29
Subject:Cybergraphics displays :(

Hi,

I am trying to display a planar bitmap on cybergraphics screen i am
converting the planar display to a chunky display and then trying to
display it using writepixelarray it does not work can anyone tell what
is wrong from the code below?

WBStartup ;start the code without crashing
NoCli
WBenchToFront_
WbToScreen 1

NEWTYPE.SMode ;store the screen mode here
DisplayID.l
DisplayWidth.l
DisplayHeight.l
DisplayDepth.w
OverscanType.w
;AutoScroll.w
End NEWTYPE
*SCRvp.ViewPort=0
width=640 ;default bitmap width
height=512 ;default bitmap height
SCRDisplayID.l = $00021000 ;screenmode
SCRoverscan.w=0 ;overscan
SCRdepth.w=8 ;depth of screen
SCRwidth.l=320 ;width of screen
SCRheight.l=256 ;height of screen
x = 0 ;x cordinates of bitmap
y = 0 ;y cordinates of bitmap

smt$="Select A Screen Mode" ;title for mode requester
Dim SMRtags.TagItem(20) ;taglist for mode requester

SMRtags(0)\ti_Tag=#ASLSM_InitialLeftEdge,10 ;these are the position for the
SMRtags(1)\ti_Tag=#ASLSM_InitialTopEdge,10 ;screenmode requester
SMRtags(2)\ti_Tag=#ASLSM_InitialWidth,320 ;width of the mode requestor
SMRtags(3)\ti_Tag=#ASLSM_InitialHeight,200 ;height of mode requestor
SMRtags(4)\ti_Tag=#ASLSM_InitialDisplayID,imode ;these are shown as "selected"
SMRtags(5)\ti_Tag=#ASLSM_InitialDisplayDepth,5 ;when the requester opens
SMRtags(6)\ti_Tag=#ASLSM_InitialDisplayWidth,320 ;default width of display
SMRtags(7)\ti_Tag=#ASLSM_InitialDisplayHeight,480 ;default height of display
SMRtags(8)\ti_Tag=#ASLSM_InitialOverscanType,1 ;default overscan type
SMRtags(9)\ti_Tag=#ASLSM_InitialAutoScroll,0 ;default for auto scroll
SMRtags(10)\ti_Tag=#ASLSM_InitialInfoOpened,0 ;no "properties" window

SMRtags(11)\ti_Tag=#ASLSM_TitleText,&smt$ ;pointer to requester title$

SMRtags(12)\ti_Tag=#ASLSM_DoDepth,1 ;0 for no depth selector
SMRtags(13)\ti_Tag=#ASLSM_DoOverscanType,1 ;0 for no OverScan selector
SMRtags(14)\ti_Tag=#ASLSM_DoWidth,1 ;0 for no width gadget
SMRtags(15)\ti_Tag=#ASLSM_DoHeight,1 ;0 for no height gadget
SMRtags(16)\ti_Tag=#ASLSM_DoAutoScroll,1

SMRtags(17)\ti_Tag=#ASLSM_MinHeight,200 ;minimum height allowed
SMRtags(18)\ti_Tag=#ASLSM_MinWidth,320 ;minimum width allowed
SMRtags(19)\ti_Tag=#ASLSM_MinDepth,8 ;minimum depth allowed

SMRtags(20)\ti_Tag=#TAG_DONE ;end of tag list

*sreq.SMode=0 ;Create a requestor structure
*sreq=AllocAslRequest_(2,&SMRtags(0)\ti_Tag) ;crete a requestor
ok.b=AslRequest_(*sreq,&SMRtags(0)\ti_Tag) ;open the requestor with the specified options
If ok<>0 ;if 0, the cancel gadget was hit
SCRDisplayID=*sreq\DisplayID ;get display id
SCRoverscan=*sreq\OverscanType ;get overscan type
SCRDepth=*sreq\DisplayDepth ;get the depth
SCRwidth=*sreq\DisplayWidth ;get the width
SCRheight=*sreq\DisplayHeight ;get the height
;SCRautoscroll=*sreq\AutoScroll
Else
Request "","Cancelled!","OK" ;tell user it was cancelled
EndIf
If (*sreq) Then FreeAslRequest_(*sreq) ;free requestor structure

;**************Screen mode stuff *********************

Dim SCRtags.TagItem(10)
SCRtags(0)\ti_Tag=#SA_DisplayID,SCRDisplayID ;use display id from screen mode requestor
SCRtags(1)\ti_Tag=#SA_Overscan,SCRoverscan ;use overscan from screen mode requestor
SCRtags(2)\ti_Tag=#SA_Depth,SCRdepth ;use depth from screen mode requestor
SCRtags(3)\ti_Tag=#SA_Width,SCRwidth ;use width from screen mode requestor
SCRtags(4)\ti_Tag=#SA_Height,SCRheight ;use width from screen mode requestor
SCRtags(5)\ti_Tag=#SA_Top,0 ;position to the right of the monitor
SCRtags(6)\ti_Tag=#SA_Left,0 ;position to the left of the monitor
SCRtags(7)\ti_Tag=#SA_AutoScroll,1 ;autoscroll is on!
SCRtags(8)\ti_Tag=#SA_Behind,1 ;make screen in back of display
SCRtags(9)\ti_Tag=#SA_ShowTitle,0 ;
SCRtags(10)\ti_Tag=#TAG_DONE ;end of taglist
ScreenTags 0,"Asl Requestor Example",& SCRtags(0) ;open the test screen
ShowScreen 0
LoadPalette 0,"pallete.col"
ShowPalette 0
LoadShape 0,"Buttons/button1.bsh"
LoadShape 1,"Buttons/button2.bsh"
LoadShape 2,"Buttons/button3.bsh"
LoadShape 3,"Buttons/button4.bsh"
LoadShape 4,"Buttons/button5.bsh"
LoadShape 5,"Buttons/button6.bsh"
LoadShape 6,"Buttons/button7.bsh"
LoadShape 7,"Buttons/button8.bsh"
ShapeGadget 0,0,0,$0,0,0
ShapeGadget 0,40,0,$0,1,1
ShapeGadget 0,80,0,$0,2,2
ShapeGadget 0,120,0,$0,3,3
ShapeGadget 0,160,0,$0,4,4
ShapeGadget 0,200,0,$0,5,5
ShapeGadget 0,240,0,$0,6,6
ShapeGadget 0,280,0,$0,7,7
BitMap 1,640,480,8
LoadIFF "zones/area1.iff",1
MBitmap 0,640,480
MPlanar16ToBitmap 0,1
Window 0,0,SCRheight-40,SCRwidth,40,$1800,"",0,1,0
*SCRvp=ViewPort(0)
WritePixelArray_ MBitmapPtr(0),0,0,MBitmapWidth(0),*SCRvp,0,0,640,480,#RECTFMT_LUT8
Repeat
Select WaitEvent
Case $200
exit =1
Case $40
Select GadgetHit
Case 0
Case 1
Case 2
Case 3
Case 4
Case 5
Case 6
Case 7
exit=1
End Select
End Select
Until exit=1
End



ICQ#: 33315204
Url :

---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie